package dao.proxy;

import java.lang.reflect.Proxy;

/**
 * @Description
 * @Author 李楚鹏
 * @Date 2024/11/29 11:49
 **/

public class IntermediaryJdkProxyFactory {

    public static <T> T create(Object target){
        IntermediaryInvocationHandler handler=new IntermediaryInvocationHandler();
        handler.setTarget(target);
        return (T) Proxy.newProxyInstance(target.getClass().getClassLoader(),target.getClass().getInterfaces(),handler);
    }
}
